home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 010 / blit.arc / RECTX.C < prev    next >
Encoding:
C/C++ Source or Header  |  1985-05-23  |  800 b   |  31 lines

  1. /*
  2.  * name:         rectxrect
  3.  *
  4.  * description: test to see if the two rectangles r and s intersect.
  5.  *
  6.  * synopsis:     boolean rectxrect (r, ss)
  7.  *              struct rectangle    *r;
  8.  *              struct rectangle    *ss;
  9.  *
  10.  * globals:      none.
  11.  *
  12.  * calls:        nothing.
  13.  *
  14.  * called by:    newlayer  (newlayer.c)
  15.  *              addobs     (addobs.c)
  16.  *              layerop    (layerop.c)
  17.  *              rlayerop   (rlayerop.c)
  18.  *              upfront    (upfront.c)
  19.  */
  20. #include "layers.h"
  21.  
  22. boolean rectxrect(r, ss)
  23. struct rectangle  *r;
  24. struct rectangle  *ss;
  25. {
  26.    return ((r -> origin.x < ss -> corner.x) &&
  27.            (ss -> origin.x < r -> corner.x) &&
  28.            (r -> origin.y < ss -> corner.y) &&
  29.            (ss -> origin.y < r -> corner.y));
  30. }
  31.